<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件的触发</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        #box{
            border: 1px solid black;
            width: 200px;
            height: 30px;
            margin: 0 auto;

        }
        #btn{
            width: 200px;
            height: 300px;
            background-color: yellowgreen;
            margin: 0px auto;
            display: none;
        }
    </style>
</head>
<body>
            <div id="box">想去的地方   <div id="btn" ></div></div>

            <script>
                function foo() {
                    btn.style.display ='block';
                }
                function foo1() {
                    btn.style.display ='none';
                }
                document.getElementById('box').onmouseover = foo
                document.getElementById('box').onmouseout = foo1

                //onmouseover
                //onmouseout
                //绑定在同一个对象上
            </script>
</body>
</html>